Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move phpcs configuration from the-build into a phpcs.xml file #185

Merged
merged 4 commits into from
Oct 6, 2022

Conversation

becw
Copy link
Member

@becw becw commented Mar 11, 2022

Alternative to #183.

This pulls out all of the phpcs config from the-build and puts it in a default phpcs.xml file. This should allow running the project's phpcs config by just running phpcs (or vendor/bin/phpcs) without any special arguments. It also makes it more visible to developers new to a project that phpcs is available.

This config file should probably be tested in an actual project.

If a project updates from an older version of the-build to a version that includes these changes, they would need to:

  • Update the build.xml to use the new command
  • Copy the new phpcs.xml file into the project

@becw becw requested a review from byrond March 11, 2022 00:32
@becw
Copy link
Member Author

becw commented Mar 12, 2022

Ooh, maybe we can do this for phpmd too.

@eric-schmidt eric-schmidt self-requested a review March 17, 2022 16:09
@eric-schmidt
Copy link

@becw I tried testing this on a live project; however, I didn't have a good one where I could actually push something up, so I was just testing by running the phpcs command in the repo root; however, it errors out on a ton of stuff that phpcs wouldn't typically notice. Running the command in the repo root should pick up this XML file in the same way that the build step would, is that right?

Maybe it would be best to just find a project where I can make this change in a PR and push it up to truly test the build tooling 🤔

@becw
Copy link
Member Author

becw commented Oct 6, 2022

I think Eric was getting more coding errors/suggestions because the old coding standard was just "Drupal", and this phpcs file has both "Drupal" and "DrupalPractice". I think for new projects, having both in place is better.

@becw becw force-pushed the phpcs-config-file branch from 8a56e2a to 8499d85 Compare October 6, 2022 19:45
@becw becw merged commit 37e588c into develop Oct 6, 2022
@becw becw deleted the phpcs-config-file branch October 6, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants